package com.spring.framwork.springmvc;

import com.spring.framwork.spring.annotation.Component;
import com.spring.framwork.springmvc.annotation.Controller;
import com.spring.framwork.springmvc.annotation.Param;
import com.spring.framwork.springmvc.annotation.RequestMappering;

@Controller
@RequestMappering("/helow")
@Component
public class HellowController {
    @RequestMappering("/hellow")
    public String hellow(@Param("name") String name, @Param("age") Integer age){
        return String.format("<h1> Hellow word name=%s age=%s</h1>",name,age);
    }
    @RequestMappering("/html")
    public ModelAndView html(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setView("index.html");
//        modelAndView.getContext().put("name",name);
//        modelAndView.getContext().put("age",age.toString());
        return modelAndView;
    }
}
